package com.l024.loanthief.entity;

import androidx.annotation.Nullable;

import java.io.Serializable;

/**
 * @author wu_ming_zhi_bei
 * @date 2021/1/18 13:33
 * @Notes
 */
public class UserEntity implements Serializable {
    private int id;
    private String name;
    private String ip;
    private int icon;
    private int type;//类型

    public UserEntity() {
    }

    public UserEntity(int id, String name, String ip, int icon, int type) {
        this.id = id;
        this.name = name;
        this.ip = ip;
        this.icon = icon;
        this.type = type;
    }

    public int getType() {
        return type;
    }

    public void setType(int type) {
        this.type = type;
    }

    public int getId() {
        return id;
    }

    public void setId(int id) {
        this.id = id;
    }

    public String getName() {
        return name;
    }

    public void setName(String name) {
        this.name = name;
    }

    public String getIp() {
        return ip;
    }

    public void setIp(String ip) {
        this.ip = ip;
    }

    public int getIcon() {
        return icon;
    }

    public void setIcon(int icon) {
        this.icon = icon;
    }


    @Override
    public boolean equals(@Nullable Object object) {
        if (this == object) {
            return true;
        }
        if(object instanceof UserEntity){
            UserEntity userEntity = (UserEntity)object;
            return userEntity.name.equals(this.name)&&userEntity.ip.equals(this.ip);
        }else{
            return false;
        }
    }

    @Override
    public String toString() {
        return "UserEntity{" +
                "id=" + id +
                ", name='" + name + '\'' +
                ", ip='" + ip + '\'' +
                ", icon=" + icon +
                ", type=" + type +
                '}';
    }
}
